package cxy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.Map;

@Controller
public class Controller2 {

    @RequestMapping("/ModelAttributTest.do")
    public String ModelAttributTest(Map<String ,Object> mp,@ModelAttribute("hahahaName") String xianzhe){
        System.out.println(xianzhe);
        System.out.println(mp.get("hahahaName"));
        System.out.println(mp.get("hahaha2Name"));
        ModelAttributTest1(mp,"ss");
        return "ModelAttributTest";
    }


    public void ModelAttributTest1(Map<String ,Object> mp,@ModelAttribute("hahahaName") String xianzhe){
        System.out.println(xianzhe);
        System.out.println(mp.get("hahahaName"));
        System.out.println(mp.get("hahaha2Name"));

    }


    @ModelAttribute("hahahaName")
    public String hahaha(){
        return "hahaha";
    }

    @ModelAttribute("hahaha2Name")
    public String hahaa2(){
        return "hahaha2";
    }

}
